/*
 * @Author: moeWang
 * @Date: 2022-03-02 16:21:32
 * @LastEditTime: 2022-03-03 14:31:56
 * @LastEditors: moeWang
 * @Description:
 * @FilePath: \nest-web\src\logical\common\models\BaseResult.model.ts
 */

import { ApiPropertyOptional } from '@nestjs/swagger';

export class BaseResultModel<T> {
  @ApiPropertyOptional({ description: '返回标识' })
  private error_code: number = 200;

  @ApiPropertyOptional({ description: '错误信息' })
  private error_msg: string = '';

  private data: T;

  public getError_code(): number {
    return this.error_code;
  }

  public setError_code(error_code: number): void {
    this.error_code = error_code;
  }

  public getError_msg(): string {
    return this.error_msg;
  }

  public setError_msg(error_msg: string): void {
    this.error_msg = error_msg;
  }

  public getData(): T {
    return this.data;
  }

  public setData(data: T): void {
    this.data = data;
  }
}
